home *** CD-ROM | disk | FTP | other *** search
- unit TstNCpyu;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls;
-
- type
- TForm1 = class(TForm)
- Button1: TButton;
- edSourceFile: TEdit;
- edDestFile: TEdit;
- Label1: TLabel;
- Label2: TLabel;
- procedure Button1Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- uses
- AAThdNCp;
-
- {$R *.DFM}
-
- procedure TForm1.Button1Click(Sender: TObject);
- var
- SrcFile : TFileStream;
- DestFile : TaaStreamArray;
- begin
- SrcFile := nil;
- DestFile[0] := nil;
- DestFile[1] := nil;
- DestFile[2] := nil;
- try
- Button1.Enabled := false;
- SrcFile := TFileStream.Create(edSourceFile.Text, fmOpenRead + fmShareDenyNone);
- DestFile[0] := TFileStream.Create(edDestFile.Text, fmCreate);
- DestFile[1] := TFileStream.Create(edDestFile.Text + '1', fmCreate);
- DestFile[2] := TFileStream.Create(edDestFile.Text + '2', fmCreate);
- AAThreadedMultiCopyStream(SrcFile, 3, @DestFile);
- finally
- SrcFile.Free;
- DestFile[0].Free;
- DestFile[1].Free;
- DestFile[2].Free;
- Button1.Enabled := true;
- end;
- end;
-
- end.
-